<html>
    <head>
        <title></title>
		    <meta charset="utf-8" />
        <link rel="stylesheet" type="text/css" href="tautocomplete.css" />
		<script src="../jquery/jquery-1.9.1.js"></script>
        <script src="tautocomplete.js" type="text/javascript"></script>
        <script>
		$(document).ready(function () {
                var text2 = $("#Text2").tautocomplete({
                    width: "250px",
                    columns: ['名称','编码'],
					ajax: {
                        url: "http://localhost:8080/cargo/cache/getDictParam",
                        type: "GET",
                        data: function () {
							var searchData =  text2.searchdata();
                            return {"name_startsWith": searchData};
                        },
                        success: function (jsonData) {
                            var filterData = [];
                            $.each(jsonData, function (i, v) {
								var obj = new Object();
								obj.INDX = v.INDX;
								obj.value = v.HS_CNAME;
								obj.key = v.HS_CODE;
                                //filterData.push({"":"","HS_CODE":v.HS_CODE,"HS_CNAME":v.HS_CNAME});
                                filterData.push(obj);
                            });
                            return filterData;
                        }
                    },
                    onchange: function () {
                        $("#ta-txt").html(text2.text());
                        $("#ta-id").html(text2.id());
                    }
                });
            });
          
        </script>
    </head>
    <body><br /><br /><br /><br /><br />
      <div style="width: 100%; text-align:center;">
            <input type="text" id="Text2" style="width: 200px; font-size:1.2em;" /><br /><br />
            Text: <span id="ta-txt"></span><br />
            ID: <span id="ta-id"></span><br />
        </div>
    </body>
</html>
